#!/usr/bin/python
# -*- coding: utf-8 -*-
# 迭代找出最大和最小


def findMinAndMax(lst):

    while len(lst) <= 1:

        return lst
    
    i_max = i_min = lst[0]
    for lst_i in lst:
        if lst_i > i_max:
            i_max = lst_i
        if lst_i < i_min:
            i_min = lst_i
        # print(i_min, i_max)
    return (i_min, i_max)

# lst = [1,3,0,45,-1,100]

lst = [n for n in range(1000**2)]
print(findMinAndMax(lst))


